package com.tiger.statefulsb.sample4;

import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

public class Sample4Client {
	public static void main(String args[]) {
		try {
			InitialContext ctx = new InitialContext();
			Object obj = ctx.lookup("comp/env/ejb/ShoppingCartBean04");
			ShoppingCartHome shoppingCartHome = (ShoppingCartHome) PortableRemoteObject.narrow(obj, ShoppingCartHome.class);

			ShoppingCart shoppingCart = shoppingCartHome.createWithSpecialPresents();
			for (int i = 0; i < 11; i++) {
				shoppingCart.add("テレビ", 49800);
			}
			shoppingCart.remove();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
